import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2025-07-03
 * Time: 16:17
 */
public class Test16 {
    public static int[] productExceptSelf(int[] num) {
        int n = num.length;
        // 前缀
        int[] f = new int[n];
        // 后缀
        int[] g = new int[n];
        // 初始化
        f[0] = g[n-1] = 1;
        //f[0] = 1,f[1]=1, f[2] = 2,f[3] = 6
        for(int i = 1; i < n; i++) {
            f[i] = f[i-1] * num[i-1];
        }
        for(int j = n-2; j >= 0; j--) {
            g[j] = g[j+1] * num[j+1];
        }
        //g[3] = 1, g[2] = 4, g[1] = 12,g[0] = 24
        int[] ret = new int[n];
        for(int i = 0; i < n; i++) {
            ret[i] = f[i] * g[i];
        }
        return ret;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] num = new int[n];
        for(int i = 0; i < n; i++) {
            num[i] = sc.nextInt();
        }
        int[] ret = productExceptSelf(num);
        System.out.println(Arrays.toString(ret));
    }
}
